package com.cskaoyan.service;

import com.cskaoyan.bean.User.User;
import com.cskaoyan.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    UserMapper userMapper;
    @Override
    public int insertDoubleUser(User user1, User user2) {
        //我们要看的是：是否是执行完一个mapper层的方法就提交了事务 👉 是
        userMapper.insertUser(user1); //这个事务提交了
        int i = 1 / 0;
        userMapper.insertUser(user2);
        return 0;
    }
}
